Matthias Clasen [Sat, 14 Dec 2019 03:50:14 +0000 (22:50 -0500)]
inspector: Use a dropdown for size groups
Use a GtkDropDown for the modes of size groups.
Matthias Clasen [Sat, 14 Dec 2019 03:33:13 +0000 (22:33 -0500)]
inspector: Use a dropdown for controllers
Use a GtkDropDown for the phases of event controllers.
Matthias Clasen [Sat, 14 Dec 2019 03:12:15 +0000 (22:12 -0500)]
inspector: Use a dropdown for attribute mapping
Use a GtkDropDown for the attribute mapping editor.
Matthias Clasen [Fri, 13 Dec 2019 21:19:53 +0000 (16:19 -0500)]
inspector: Use dropdowns in property editor
Replace combo boxes by dropdowns in the property editor.
Matthias Clasen [Sun, 22 Dec 2019 02:06:50 +0000 (21:06 -0500)]
filechooser: Use a dropdown for choices
Matthias Clasen [Sun, 22 Dec 2019 01:12:11 +0000 (20:12 -0500)]
filechooser: Use a dropdown for the filter combo
Replace an internal use of GtkComboBox with GtkDropDown.
Matthias Clasen [Mon, 9 Dec 2019 01:22:06 +0000 (20:22 -0500)]
Add GtkDropDown
This is a simple drop down control using list models.
Benjamin Otte [Sun, 24 May 2020 22:07:07 +0000 (00:07 +0200)]
xxx: isnanf() is some wtf
Matthias Clasen [Mon, 23 Dec 2019 23:23:59 +0000 (18:23 -0500)]
builderlistitemfactory: Precompile the xml
This is the one place where we can really take advantage
of precompiling, since we instantiate this template
over and over.
Matthias Clasen [Sat, 30 May 2020 18:50:22 +0000 (14:50 -0400)]
gtk-demo: Use single-click-activate for minesweeper
The explanation say we do, so do it.
Matthias Clasen [Mon, 23 Dec 2019 20:22:35 +0000 (15:22 -0500)]
Spread single-click-activate api
This makes sense to have in all the views,
not just GtkListView.
Matthias Clasen [Fri, 29 May 2020 20:10:34 +0000 (16:10 -0400)]
docs: Add a listview overview section
Add a conceptual overview for all the listmodel-based
widgets.
Fixes: #2214
Matthias Clasen [Mon, 16 Dec 2019 04:48:34 +0000 (23:48 -0500)]
gtk-demo: Add filtering to the settings demo
A demo of filtering with lists was missing so far.
Matthias Clasen [Sat, 14 Dec 2019 16:53:24 +0000 (11:53 -0500)]
gtk-demo: Demo columnview sorting
Enhance the settings demo to have a sortable column.
Matthias Clasen [Fri, 29 May 2020 17:25:36 +0000 (13:25 -0400)]
gtk-demo: Cosmetic improvements to the listview demos
Set default sizes, window titles and add more
detail to the descriptions.
Matthias Clasen [Wed, 18 Dec 2019 21:58:10 +0000 (16:58 -0500)]
gtk-builder-tool: Minimally validate <binding>
Check that the toplevel property name is legit.
Benjamin Otte [Wed, 18 Dec 2019 04:39:04 +0000 (05:39 +0100)]
testsuite: Add tests for GtkTreeListSorter
Matthias Clasen [Sun, 8 Dec 2019 22:34:10 +0000 (17:34 -0500)]
Add GtkTreeListRowSorter
This is a special-purpose sorter that can
apply the sorting of another sorter to the
levels of a GtkTreeListModel.
Benjamin Otte [Tue, 17 Dec 2019 14:35:24 +0000 (15:35 +0100)]
testcolumnview: Add sorters
Matthias Clasen [Wed, 4 Dec 2019 13:52:12 +0000 (08:52 -0500)]
column view title: Show sort indicators
Matthias Clasen [Wed, 4 Dec 2019 02:31:57 +0000 (21:31 -0500)]
columnview: Add a sort-by api
Matthias Clasen [Wed, 4 Dec 2019 13:13:13 +0000 (08:13 -0500)]
columnview: Add sorting
This is a somewhat large commit that:
- Adds GtkColumnViewSorter
This is a special-purpose, private sorter implementation which sorts
according to multiple sorters, allowing each individual sorter to be
inverted. This will be used with clickable column view headers.
- Adds a read-only GtkColumnView::sorter property
The GtkColumnView creates a GtkColumnViewSorter at startup that it uses
for this property.
- Adds a writable GtkColumnViewColumn::sorter property
This allows defining per-column sorters. Whenever an application sets a
sorter for a column, the header becomes clickable and whenever
a header is clicked, that column's sorter is prepended to the list of
sorters, unless it is already the first sorter, in which case we invert
its order. No column can be in the list more than once.
Matthias Clasen [Sat, 14 Dec 2019 01:57:57 +0000 (20:57 -0500)]
listview: Add single-click-activate
Add a single-click-activate property to GtkListView.
Matthias Clasen [Sat, 14 Dec 2019 01:56:32 +0000 (20:56 -0500)]
listitemwidget: Add single-click-activate
Add a mode to GtkListItemWidget that activates on
single click and selects on hover. Make
GtkListItemManager set this on its items
when its own 'property' of the same name is set.
Matthias Clasen [Fri, 13 Dec 2019 19:03:20 +0000 (14:03 -0500)]
builder-tool: Pass through CDATA where it makes sense
This avoids a ton of escaping for
GtkBuilderListItemFactory::bytes.
Matthias Clasen [Fri, 13 Dec 2019 03:45:43 +0000 (22:45 -0500)]
docs: Reorganize list widgets in their own chapter
Benjamin Otte [Thu, 28 Nov 2019 03:00:39 +0000 (04:00 +0100)]
fontchooserwidget: Port to listmodels
The port is kind of evil, in that it stores either a PangoFontFamily or a
PangoFontFace in the list, depending on if the fontchooser is configured
to select fonts or faces.
It also does not cache the font description anymore, so more calls to
pango_font_describe() may happen.
If both of these issues turn out problematic, the fontchooser would need
to resurrect GtkDelayedFontDescription again and put objects of that
type through the model.
These changes depend on Pango 1.46's introduction of listmodels and
various new getters, so the dependency has been upgraded.
Matthias Clasen [Sat, 14 Dec 2019 20:36:34 +0000 (15:36 -0500)]
Add some tests for expression binding
In particular, test that expressios can deal with object == this.
Benjamin Otte [Thu, 28 Nov 2019 01:32:12 +0000 (02:32 +0100)]
expression: Allow passing a this object to bind()
This gives a bit more control over the arguments passed to expressions.
Benjamin Otte [Sun, 24 Nov 2019 07:07:33 +0000 (08:07 +0100)]
gtk-demo: Add a Clocks demo
This demo is meant to showcase expressions.
It also needs the fixes in glib 2.64 to work properly.
Benjamin Otte [Tue, 26 Nov 2019 05:09:20 +0000 (06:09 +0100)]
xxx: Add a hack to make paintables transform to/from objects
See also: https://gitlab.gnome.org/GNOME/glib/merge_requests/1251
Benjamin Otte [Sat, 9 Nov 2019 00:13:28 +0000 (01:13 +0100)]
inspector: Remove private struct for prop editor
Benjamin Otte [Fri, 8 Nov 2019 23:43:41 +0000 (00:43 +0100)]
inspector: Make Controller page a GtkWidget
Benjamin Otte [Fri, 8 Nov 2019 23:36:59 +0000 (00:36 +0100)]
inspector: Remove private struct from controllers
Benjamin Otte [Fri, 8 Nov 2019 20:23:03 +0000 (21:23 +0100)]
columnview: Add header
This uses a custom GtkColumnViewTitle widget. So far that widget is
pretty boring, but that will change once we added
resizing, reordering, dnd, sorting, hiding/showing of columns or
whatever UIs we want.
Benjamin Otte [Mon, 28 Oct 2019 19:50:25 +0000 (20:50 +0100)]
tests: Add testcolumnview
Benjamin Otte [Thu, 7 Nov 2019 22:40:47 +0000 (23:40 +0100)]
columnview: Add a custom LayoutManager
The ColumnView now allocates column widths first and then the individual
rows use the new layout manager which looks at the column allocations to
allocate their children.
Benjamin Otte [Thu, 7 Nov 2019 17:56:52 +0000 (18:56 +0100)]
constraint-editor: Don't poke around in widget internals
Benjamin Otte [Thu, 7 Nov 2019 11:17:53 +0000 (12:17 +0100)]
columnview: Fix styling with Adwaita
- Use "treeview" as the node name
- Add .view style class
Benjamin Otte [Tue, 5 Nov 2019 16:10:29 +0000 (17:10 +0100)]
inspector: Port object tree to GtkColumnView
Benjamin Otte [Sat, 2 Nov 2019 05:15:38 +0000 (06:15 +0100)]
columnview: Add GtkColumnViewCell
It's a GtkListItemWidget subclass that tracks the column it belongs to
and allows the column to track it.
We also use this subclass to implement sizing support so columns share
the same size and get resized in sync.
Benjamin Otte [Mon, 4 Nov 2019 23:40:17 +0000 (00:40 +0100)]
widget: Add a hook for resizes
It's private, no APIs, we don't talk about it. But we will start using
it very soon, so we can do size request caching in columns and avoid
sizegroups...
Benjamin Otte [Thu, 31 Oct 2019 02:16:45 +0000 (03:16 +0100)]
columnview: Implement GtkScrollable
Just forward it to the listview for now.
Benjamin Otte [Wed, 30 Oct 2019 17:03:23 +0000 (18:03 +0100)]
columnview: Add listitems for the columns
They are not aligned in columns yet, but they do exist.
Benjamin Otte [Sun, 3 Nov 2019 02:59:04 +0000 (03:59 +0100)]
listitemwidget: Lazily create listitems
We only create them in root/unroot (they should be created in
appear/disappear, but that vfunc doesn't exist yet), that way we can
avoid expensive work while the widget isn't used for anything.
Benjamin Otte [Sun, 3 Nov 2019 02:34:56 +0000 (03:34 +0100)]
listitem: Move position/item/selected tracking to widget
This way, we can ensure it's always there when we need it (before the
item gets created) and gone when we don't (if some GC language holds on
to the item after we've destroyed the widget).
Benjamin Otte [Sun, 3 Nov 2019 02:17:37 +0000 (03:17 +0100)]
listitemwidget: Add a private struct
I had to rename the item property to list_item anyway, so I could just
do the next step with it.
Benjamin Otte [Sun, 3 Nov 2019 01:23:46 +0000 (02:23 +0100)]
listitemfactory: Simplify
Instead of 6 vfuncs, we now have 3 and rely on the factory keeping track
of what it needs to do.
We're doing lots of dancing from one object to another here, but this
will hopefully get simpler with further commits.
Benjamin Otte [Sat, 2 Nov 2019 17:56:36 +0000 (18:56 +0100)]
listitemfactory: Reorganize vfuncs
Instead of bind/rebind/update/unbind, we now just have update, and the
factories get to interpret that in the way they want.
Benjamin Otte [Fri, 1 Nov 2019 06:31:38 +0000 (07:31 +0100)]
listitem: Make this a GObject
This splits GtkListItem into 2 parts:
1. GtkListItem
This is purely a GObject with public API for developers who want to
populate lists. There is no chance to cause conflict with GtkWidget
properties that the list implementation assumed control over and
defines a clear boundary.
2. GtkListItemWidget
The widget part of the listitem. This is not only fully in control of
the list machinery, the machinery can also use different widget
implementations for different list widgets like I inted to for
GtkColumnView.
Benjamin Otte [Fri, 1 Nov 2019 06:30:32 +0000 (07:30 +0100)]
builder: Make gtk_builder_extend_with_template() work with objects
This will be relevant later when we introduce GtkListItem which is not a
GtkWidget.
Benjamin Otte [Tue, 29 Oct 2019 05:35:46 +0000 (06:35 +0100)]
gtk-demo: Add a Coverflow application launcher
This is roughly the simplest demo I could come up with.
But I documented it, so there's your tutorial.
Related: #2214
Benjamin Otte [Tue, 29 Oct 2019 04:58:02 +0000 (05:58 +0100)]
Add GtkSignalListItemFactory
So the poor Rust users can actually use this.
I would totally not use this ever!
Benjamin Otte [Mon, 28 Oct 2019 19:50:49 +0000 (20:50 +0100)]
columnview: Allow adding/removing columns
... and make that work in UI files via <child>, too.
Benjamin Otte [Mon, 28 Oct 2019 08:47:52 +0000 (09:47 +0100)]
gtk-demo: Add a minesweeper demo
The demo shows creating ones own listmodel and using it to fill a grid.
I am totally getting the hang of React btw:
500 lines of logic with no UI code and 100 lines of GtkBuilder XML and
I get a sweet UI.
Benjamin Otte [Mon, 28 Oct 2019 00:18:14 +0000 (01:18 +0100)]
Add GtkColumnView skeleton
It's just a copy/paste of the listview code with all the internals
gutted. The code doesn't do anything.
Benjamin Otte [Sun, 27 Oct 2019 07:03:03 +0000 (08:03 +0100)]
wip: Add GtkCoverFlow
The widget mostly works out of the box, but some tweaking may be
necessary (in particular in the theme) and the gtk-demo changes might
require removing before this is production-ready.
Benjamin Otte [Sat, 26 Oct 2019 06:49:27 +0000 (08:49 +0200)]
listbase: Take over anchor handling
With that, pretty much all code but allocating the widgets is gone from
the gridview and listview.
Benjamin Otte [Fri, 25 Oct 2019 05:39:57 +0000 (07:39 +0200)]
listbase: Add vfuncs to convert positions to/from coordinates
... and use that to implement PageUp/PageDown.
With that, all keyboard handling has been moved to GtkListBase.
Benjamin Otte [Thu, 24 Oct 2019 04:49:38 +0000 (06:49 +0200)]
listbase: Move focus moving keybindings here
The focus tracker is not yet moved because that depends on scroll_to()
support and we don't have that yet.
Whoops.
So we use a hack.
Benjamin Otte [Thu, 24 Oct 2019 00:14:34 +0000 (02:14 +0200)]
Remove gtk_selection_model_user_select_item() again
This reverts commit
6a164ab306dad9096bde736c907494c71086d3c4.
The function was awkward and we now have only one caller again, so we
can fold it back into it.
Benjamin Otte [Thu, 24 Oct 2019 00:07:37 +0000 (02:07 +0200)]
listbase: Move orientable implementation here
Benjamin Otte [Wed, 23 Oct 2019 13:02:02 +0000 (15:02 +0200)]
listbase: Move selection handling here
Benjamin Otte [Wed, 23 Oct 2019 00:34:28 +0000 (02:34 +0200)]
listbase: Move item manager here
Nothing really changes, because both ListView and GridView still keep
self->item_manager around, but it's set up to point at the base's item
manager.
This way we can slowly move things to GtkListBase that need the item
manager (like trackers).
Benjamin Otte [Tue, 22 Oct 2019 21:46:34 +0000 (23:46 +0200)]
listbase: Move GtkScrollable implementation
Shared code between GtkGridView and GtkListView.
Benjamin Otte [Tue, 22 Oct 2019 06:01:16 +0000 (08:01 +0200)]
Add GtkListBase
This is a base item for GTK's list widgets so they can share some (read:
hopefully a lot of) code.
Benjamin Otte [Tue, 22 Oct 2019 02:59:34 +0000 (04:59 +0200)]
gridview: Simplify allocation code
It doesn't fix the bug I'm after, but it looks a lot better.
Benjamin Otte [Tue, 22 Oct 2019 01:21:39 +0000 (03:21 +0200)]
listview: Port various gridview improvements
- Handle anchor as align + top/bottom
This fixes behavior for cells that are higher than the view
- Add gtk_list_view_adjustment_is_flipped()
This should fix RTL handling of horizontal lists
- Fix scrolling
This should make scrolling more reliable, particularly on short lists
that are only a few pages long.
Benjamin Otte [Fri, 18 Oct 2019 18:47:48 +0000 (20:47 +0200)]
demo: Add a file browser demo
Benjamin Otte [Mon, 21 Oct 2019 02:11:24 +0000 (04:11 +0200)]
gridview: Add move keybindings
Benjamin Otte [Sun, 20 Oct 2019 20:05:48 +0000 (22:05 +0200)]
gridview: Implement (un)select all
Adds listitem.select-all and listitem.unselect-all actions and installs
the same keybindings as the treeview for those actions.
Benjamin Otte [Sun, 20 Oct 2019 18:09:24 +0000 (20:09 +0200)]
gridview: Add a focus tracker
... and use that to properly update selections when moving around with
the arrow keys.
Benjamin Otte [Sun, 20 Oct 2019 16:52:28 +0000 (18:52 +0200)]
gridview: Implement list.scroll-to action
Benjamin Otte [Sun, 20 Oct 2019 06:13:36 +0000 (08:13 +0200)]
gridview: Add activation
Benjamin Otte [Sat, 19 Oct 2019 19:45:24 +0000 (21:45 +0200)]
gridview: Implement minimum row height
We only allocate a certain amount of widgets - and we don't want to run
out of them. So we make all widgets high enough for this to never
happen.
Benjamin Otte [Sat, 19 Oct 2019 19:32:56 +0000 (21:32 +0200)]
gridview: Implement the list.select-item action
Benjamin Otte [Sat, 19 Oct 2019 19:29:52 +0000 (21:29 +0200)]
selectionmodel: Add gtk_selection_model_user_select_item()
I'm not sure this should be public API because it's incredibly awkward.
But it should definitely be shared between list widget implementations.
Benjamin Otte [Sat, 19 Oct 2019 16:20:04 +0000 (18:20 +0200)]
gridview: Implement anchors and scrolling
Benjamin Otte [Sat, 19 Oct 2019 01:19:56 +0000 (03:19 +0200)]
listitemmanager: Handle NULL factory
Just don't call it and create empty listitems.
Timm Bäder [Tue, 15 Oct 2019 13:39:59 +0000 (15:39 +0200)]
demo: Use a listview as sidebar
Benjamin Otte [Fri, 31 May 2019 02:52:13 +0000 (04:52 +0200)]
gtk-demo: Introduce awards
We need a way to get a useful listbox, so here we go!
Benjamin Otte [Tue, 3 Dec 2019 06:37:24 +0000 (07:37 +0100)]
builder: Autofill scope property of listitemfactory
I couldn't come up with a better way to automatically inherit the scope
in the builder list item factory that didn't involve a magic
incantation in the XML file. And I do not want developers to know magic
incantations to do a thing that should pretty much always be done.
Benjamin Otte [Tue, 3 Dec 2019 06:03:10 +0000 (07:03 +0100)]
builderlistitemfactory: Add scope argument
This way, the scope used when creating builder instances can be
influenced. This way, callbacks can be passed into the factory.
Benjamin Otte [Fri, 18 Oct 2019 02:07:04 +0000 (04:07 +0200)]
listitemfactory: Make the builder factory properly buildable
Turn the construct arguments into construct properties so that they can
be set from ui files.
Benjamin Otte [Wed, 16 Oct 2019 19:31:50 +0000 (21:31 +0200)]
listview: Add move keybindings
My god, these are a lot.
And my god, these are complicated to get right.
Benjamin Otte [Wed, 16 Oct 2019 19:31:00 +0000 (21:31 +0200)]
listview: Add gtk_list_view_get_position_at_y()
Benjamin Otte [Wed, 16 Oct 2019 14:28:47 +0000 (16:28 +0200)]
listitem: Add "listitem.select" action and keybindings for it
In fact, grab space with all modifiers to toggle selection of the
current item.
Benjamin Otte [Wed, 16 Oct 2019 12:57:39 +0000 (14:57 +0200)]
listview: Add a focus tracker
This ensures that the row with the input focus always stays available,
even when scrolled out of view.
Benjamin Otte [Tue, 15 Oct 2019 23:59:01 +0000 (01:59 +0200)]
listview: Implement (un)select all
Adds listitem.select-all and listitem.unselect-all actions and installs
the same keybindings as the treeview for those actions.
Benjamin Otte [Tue, 15 Oct 2019 21:45:33 +0000 (23:45 +0200)]
listview: Track focus movements and update selection
When focus moves via tab/arrow, we need to select the new item.
Benjamin Otte [Tue, 15 Oct 2019 21:06:36 +0000 (23:06 +0200)]
listview: Implement activation
- a GtkListview::activate signal
- a GtkListItem::activatable property
- activate list items on double clicks and <Enter> presses
Benjamin Otte [Tue, 15 Oct 2019 04:07:26 +0000 (06:07 +0200)]
treeexpander: Implement input support
This implements all the keybindings from GtkTreeView that can be
supported.
It does not implement expand-all, because supporting that means
causing the TreeListModel to emit lots of create_model vfuncs which in
turn would cause many items-changed signal which in turn would cause
many signal handlers to run which in turn would make "expand-all" very
reentrant, and I'm uneasy about supporting that.
For the mouse, just add a click gesture to the expander icon that toggles
expanded state.
Benjamin Otte [Tue, 15 Oct 2019 02:18:10 +0000 (04:18 +0200)]
listitem: Change focus handling
Focus in the listitem now works like this:
1. If any child can take focus, do not ever attempt
to take focus.
2. Otherwise, if this item is selectable or activatable,
allow focusing this widget.
This makes sure every item in a list is focusable for
activation and selection handling, but no useless widgets
get focused and moving focus is as fast as possible.
Benjamin Otte [Mon, 14 Oct 2019 04:50:40 +0000 (06:50 +0200)]
inspector: Make the recorder node list use a ListView
It's quite a bit faster now, but the code is also a bit more awkward.
Pain points:
- GtkTreeListModel cannot be created in UI files because it needs
a CreateModelFunc.
Using a signal for this doesn't work because autoexpand wants to
expand the model before the signal handler is connected.
- The list item factory usage is still awkward. It's bearable here
because the list items are very simple, but still.
Benjamin Otte [Mon, 14 Oct 2019 04:22:41 +0000 (06:22 +0200)]
inspector: Use a GtkTreeExpander in the object tree
Benjamin Otte [Mon, 14 Oct 2019 04:18:25 +0000 (06:18 +0200)]
inspector: Use a treeexpander in the recorder
Benjamin Otte [Sun, 13 Oct 2019 05:40:58 +0000 (07:40 +0200)]
demo: Add a GSettings tree demo
It is meant to look somewhat like dconf-editor when it is done.
So far, it's just a list.
Benjamin Otte [Mon, 14 Oct 2019 02:31:20 +0000 (04:31 +0200)]
Add GtkTreeExpander
This is a container widget that takes over all the duties of tree
expanding and collapsing.
It has to be a container so it can capture keybindings while focus is
inside the listitem.
So far, this widget does not allow interacting with it, but it shows the
expander arrow in its correct state.
Also, testlistview uses this widget now instead of implementing
expanding itself.
Benjamin Otte [Sat, 12 Oct 2019 20:53:13 +0000 (22:53 +0200)]
gridview: Actually do something
Implement measuring and allocating items - which makes the items appear
when drawing and allows interacting with the items.
However, the gridview still does not allow any user interaction
(including scrolling).
Benjamin Otte [Sat, 12 Oct 2019 11:16:54 +0000 (13:16 +0200)]
listview: Pass the CSS name of listitems to the manager
... instead of hardcoding "row".